//
//  APIManagerInterceptor.h
//  BaoZhangWang
//
//  Created by 叶越悦 on 15/10/27.
//  Copyright © 2015年 叶越悦. All rights reserved.
//

#import <Foundation/Foundation.h>

@class APIBaseManager;
@class APIRequestManager;

@protocol APIManagerInterceptor <NSObject>

@optional
// 拦截器方法
- (BOOL)manager:(APIBaseManager *)manager beforePerformCallBackWithResponse:(URLResponse *)response;
- (void)manager:(APIBaseManager *)manager afterPerformCallBackWithResponse:(URLResponse *)response;
- (BOOL)manager:(APIBaseManager *)manager beforePerformSuccessWithResponse:(URLResponse *)response;
- (void)manager:(APIBaseManager *)manager afterPerformSuccessWithResponse:(URLResponse *)response;
- (BOOL)manager:(APIBaseManager *)manager beforePerformFailWithResponse:(URLResponse *)response;
- (void)manager:(APIBaseManager *)manager afterPerformFailWithResponse:(URLResponse *)response;

/**
 *  @author yyy, 16-04-08 15:26:16
 
 *  校验请求参数，返回nil为通过，返回error的话为有错误
 *
 *  @param manager manager
 *  @param params  请求的参数
 *
 *  @return nil为参数通过，有值的话为不通过
 */
- (BOOL)manager:(APIBaseManager *)manager shouldCallAPIWithParams:(id)params;
- (void)manager:(APIBaseManager *)manager afterCallAPIWithParams:(id)params;

@end
